Data Showcase
The Content HTML iPart lets you leverage HTML to create compelling designs;
the Data Showcase iPart lets you combine this power with variables that merge in
your iMIS data, dynamically and reusably. When you specify data sources,
such as Event and Party, you can then use variables in your HTML
that will insert values from these data sources (such as venue details), styled
for your needs. You can use for each structures to display groups of values
(such as all functions), and you can have the iPart hide itself if it detects
any data errors.
- Name - Enter a name for the content item. This text
appears during design mode (configuration).
- Title - Enter the text to display above this iPart on the
rendered page. If blank, no title displays. The title may contain data
placeholders which will be resolved against the data sources e.g. if the iPart
is showing details of an Event, the Event name could be shown within the
title.
- Do not render in design mode - Select this option to
prevent content record data from being loaded in the content editor. This
improves performance during design time (configuration).
- iPart CSS class - (optional) Enter the name of a CSS
class to associate with this iPart, which will add a DIV so named around the
iPart. Add this CSS class to an appropriate style sheet. Using such classes
lets you apply special formatting to targeted iParts in a reusable way.
- Display a border around this content - Select this option
to display a border around this iPart on the rendered page.
- Display content within a collapsible panel - Enable to
allow users to minimize the panel within the page, to work with dense pages
more efficiently.
- Show the content as collapsed - Enable to display the
panel minimized by default.
Tip: Be sure that the
Title makes clear what data is hidden from view.
- Hide the iPart if any errors are detected whilst resolving the
content - Hide the iPart from the user if any errors are detected
that will stop the content resolving fully. This will prevent the user from
seeing partly resolved content due to
- Invalid datasource definitions
- Invalid placeholder structure within the content
- References to datasource properties that do not exist
- Datasources that do not return any data
- Data sources - The data sources used to resolve
placeholders in the content.
- Content - The HTML content, containing
placeholders, that will be resolved against the data sources and
displayed to the user.
Data sources
- You can define any number of data sources.
- For your data source, you may use any valid data contract (minus
the "Data" suffix -- that is, EventData
is sourced as Event).
- Each data source has the following properties:
- As - The name by which to refer to the data source.
Each data source must has a unique name.
- From - The SOA Entity type that the data source
returns.
- Where - The where clause used to locate the Entity.
Consists of
- Property - The Entity property to search on.
Typically the Entity Id e.g. EventId, PartyId, ItemId. Multiple properties
may be specified using | as a delimiter e.g. PartyId|ItemId.
- Value - The value to search for. Can be retrieved
from a URL parameter. When using multiple Where
properties, supply a value for each property using | as a
delimiter e.g. 260|G15
- You can retrieve the Value property of the
Where clause from the URL. This allows a single iPart to
dynamically display details from a given Entity by providing the id value of
the Entity (or other such unique property value) in the URL.
- To read a parameter value from the URL, use the syntax
url:parameter, where parameter is the name of the URL parameter
(e.g., url:EventId)
- Note: Where the data source matches multiple entities, only the
first entity is resolved into the content.
Placeholders
Use placeholders within the content and the title to denote areas that will
resolve against the data sources. Placeholders may also be using to populate
attributes within HTML tags, such as the src attribute of <img> and
<a> tags.
Placeholders are specified using {} notation.
Data {#datasource[.property...] [attributes]}
The {#...} placeholder embeds data into the content or title at the
placeholder location. The placeholder consists of the following components.
- datasource - The name of the data source
- property - Optional. The name of the property. May be
chained together using dot notation e.g. prop1.prop2.prop3. Where the property
is a collection, a specific item may be accessed using [i] notation e.g.
.Address[1] would return the item at index position 1 from the Address
collection.
- attributes - Optional. A space delimited set of
attributes, some of which require values. Multiple attributes may be
specified.
- uppercase - convert the data to uppercase
- lowercase - convert the data to lowercase
- format - format non-string values, such as
Format="d", for date (search MSDN for iFormattable)
- noencode - do not HTML encode the data. This is useful
where the data contains HTML markup that you wish to be rendered in the
browser.
- resolve=~ - replace any ~ (tilde) characters in the
data with the webroot url. This is useful where the property is a URL that
uses ~ notation to denote the webroot, such as Events.ImageUrl.
Examples:
{#event.Name}
{#event.Name uppercase}
{#event.StartDateTime format="d"}
{#party.Status.Name}
{#party.Addresses[1].Address.CityName}
<img src="{#event.ImageUrl resolve=~}">Foreach {foreach alias in source [orderby [property,...]]}
The {foreach...} placeholder is used to iterate through a collection,
repeating and resolving the inner content against each item in the collection.
The opening {foreach...} placeholder must having a closing {/foreach}
placeholder. The content between the opening and closing placeholders is the
inner content. The inner content may contain placeholders, including nested
{foreach...} placeholders. The inner content is repeated and resolved against
each item in the collection.
The placeholder consists of the following components.
- alias - A name for the data source that will represent
the current item in the collection. This data source will be used in
placeholders within the inner content to refer to the item being processed.
- source - A data source and property path that refers to
the collection to iterate through e.g. event.Functions. If the data source
itself is a collection, the property path may be ommitted (typically only used
in nested foreach loops for iterating through collections of collections).
- orderby -(optional) To order the collection, use
the orderby keyword followed by a comma-delimited list of properties to
order the collection by.
- A maximum of 5 sorting properties may be specified.
- Property names must refer to properties of the objects within the
collection and may be chained using dot notation.
- Do not specify a data source in the property names.
Examples:
- Display the city from each party address:
{foreach a in party.Addresses}
{#a.Address.CityName}
{/foreach}
- Display the name of each function in an event, order by the start date and
name:
Display the data as an ordered list.
<ol>
{foreach f in event.Functions orderby StartDateTime,Name}
<li>{#f.Name}</li>
{/foreach}
</ol>